
* Input:
* OrigData/customer_level_solar_panel_20170304.csv // uses inventory (from Hans)

* Output:
* Data/solar_accounts.dta

***************************************************************
*********************** IMPORT SOLAR ACCOUNTS DATA ************
****************************************************************
clear
 
* 20170304: solar installations identified from inventory

insheet using OrigData/customer_level_solar_panel_20170304.csv

duplicates drop  

foreach var in first_date solar_start_date {
	rename `var' `var'_str
	gen `var'=date(`var'_str,"YMD")
	drop `var'_str
	format `var' %td
	}
	

rename account_id_hashed account_id 

sort account_id first_date 

collapse (firstnm) solar_start first_date, by(account_id)



save Data/solar_accounts.dta, replace
